package cn.xuqiudong.backend.module.system.main.model.response;


import cn.xuqiudong.backend.base.response.BaseApiResponse;
import cn.xuqiudong.backend.module.system.user.model.SysUser;

import java.util.HashSet;
import java.util.Set;

/**
 * 描述:
 *
 * @author Vic.xu
 * @since 2024-11-25 11:12
 */
public class ApiUserInfoResponse extends BaseApiResponse {

    private Integer  userId;

    private String username;

    private SysUser user;

    private Set<String> roles;

    public ApiUserInfoResponse() {
        this.roles = new HashSet<>();
    }

    public ApiUserInfoResponse(SysUser user) {
        this();
        this.user = user;
        this.userId = user.getId();
        this.username = user.getUsername();
        this.roles.add("admin");
    }


    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Set<String> getRoles() {
        return roles;
    }

    public void setRoles(Set<String> roles) {
        this.roles = roles;
    }

    public SysUser getUser() {
        return user;
    }

    public void setUser(SysUser user) {
        this.user = user;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }
}
